<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" xmlns="http://www.w3.org/1999/xhtml">
	<!-- 
	 	- Function BoMenu
	 	- Generic's generation of back-office menu
	 	- Don't change anything
	-->
	<xsl:template name="BoMenu">

		<xsl:if test="count(//Statics/Sls/Http/params/param[name='SlsQuick']) = 0 or (count(//Statics/Sls/Http/params/param[name='SlsQuick']) &gt; 0 and //Statics/Sls/Http/params/param[name='SlsQuick']/value != 'iFrame')">
			<div class="grey_wrapper">
				<fieldset class="no_border">
					<legend><xsl:call-template name="displayLang"><xsl:with-param name="str" select="'sls_bo_menu_category'" /><xsl:with-param name="escaping" select="'yes'" /></xsl:call-template> (<xsl:value-of select="count(//View/bo_actions/bo_action[label != 'Connection' and label != 'Disconnection'])" />)</legend>
					<div class="content" id="wrap_categorieswrapper">
						<div class="h_calc">
							<div id="menu">
								<xsl:variable name="lines" select="ceiling(count(//View/bo_actions/bo_action[label != 'Connection' and label != 'Disconnection']) div 4)" />
								<xsl:call-template name="displayMenu">
									<xsl:with-param name="i" select="'1'" />
									<xsl:with-param name="lines" select="$lines" />
								</xsl:call-template>
							</div>
						</div>
					</div>
				</fieldset>
			</div>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="displayMenu">
		<xsl:param name="i" />
		<xsl:param name="lines" />
		<xsl:variable name="start" select="($i - 1)" />
		<xsl:variable name="end" select="($i + $lines)" />		
		<div class="menu_col">
			<ul class="float_horizontal">
				<xsl:for-each select="//View/bo_actions/bo_action[label != 'Connection' and label != 'Disconnection' and (position() &gt; $start and position() &lt; $end)]">															
					<li>
						<a href="{url}">							
							<xsl:if test="selected = 'true'"><xsl:attribute name="class">selected</xsl:attribute></xsl:if>							
							<xsl:value-of select="label" />
						</a>
						 
					</li>
				</xsl:for-each>
			</ul>
		</div>
		
		<xsl:if test="ceiling($i div $lines) &lt; 4">
			<xsl:call-template name="displayMenu">
				<xsl:with-param name="i" select="$i + $lines" />
				<xsl:with-param name="lines" select="$lines" />
			</xsl:call-template>
		</xsl:if>		
	</xsl:template>
	
</xsl:stylesheet>